﻿<%@ Page MetaDescription="لايف كورة | livekora | مقالاتي"
    Language="C#" MasterPageFile="~/master.master" AutoEventWireup="true" CodeFile="UserArticles.aspx.cs"
    Inherits="UserArticles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContentPlaceHolder" runat="Server">
    <asp:Literal runat="server" ID="PageTitle"></asp:Literal>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        function DeleteArticls(ArticlsID) {
            var r = confirm("هل تريد فعلا حذف المقالة ؟")
            if (r == true) {
                DeleteArticlsMethods(ArticlsID);
            }
            else {
            }
        }
        function DeleteArticlsMethods(ArticlsID) {
            PageMethods.DeleteArticlsInfo(ArticlsID, OnDeleteArticlsSucceeded, OnDeleteArticlsFaild);
        }

        function OnDeleteArticlsSucceeded(result) {
            if (result == "true") {
                $("#" + '<%= lbtnRefreshGV.ClientID %>').trigger('click');
                $("#message-green").css("display", "");
            }
            else {
                $("#" + '<%= lbtnRefreshGV.ClientID %>').trigger('click');
                $("#message-green").css("display", "");
            }
        }
        function OnDeleteArticlsFaild(result) {
            alert("Error");
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="categories" style="width: 620px; z-index: 0">
        <ul id="menu-%d9%85%d8%ab%d8%a7%d9%84-%d8%a2%d8%ae%d8%b1" class="secondnav-menu sf-js-enabled sf-menu">
            <li id="menu-item-3332" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3332">
                <a href="/Dashboard">الرئيسية</a></li>
            <li id="Li3" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3332">
                <a href="../../../AddArticles">إضافة مقالات</a></li>
            <li id="Li1" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3332">
                <a href="../../../UserArticles">مقالات</a></li>
            <li id="Li2" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3332">
                <a href="../../../AccountSettings">تعديل معلومات الحساب</a></li>
        </ul>
    </div>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" >
        <tr >
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner" >
                    <!--  start table-content  -->
                    <div id="tbArticls" runat="server">
                        <div style="height: 20px; clear: both;">
                        </div>
                        <!--  start product-table ..................................................................................... -->
                        <table border="0" width="100%" cellpadding="0" cellspacing="0"
                            style="border: 1px solid #ccc;">
                            <asp:Repeater runat="server" ID="rptManageCategory">
                                <HeaderTemplate>
                                    <th class="table-header-repeat line-left minwidth-1" style="text-align: right; height: 50px;
                                        background-color: #e0f4ff; padding-right: 15px; width: 55%">
                                        <a href="">عنوان المقالة</a>
                                    </th>
                                    <th class="table-header-repeat line-left minwidth-1" style="text-align: center; height: 50px;
                                        background-color: #e0f4ff; width: 25%">
                                        <a href="">عدد المشاهدات</a>
                                    </th>
                                    <th class="table-header-repeat line-left minwidth-1" style="text-align: center; height: 50px;
                                        background-color: #e0f4ff; width: 15%">
                                        <a href="">حالة المقال</a>
                                    </th>
                                    <th style="text-align: left; height: 50px; background-color: #e0f4ff; width: 5%;
                                        padding-left: 10px;" class="table-header-repeat line-left minwidth-1">
                                        #
                                    </th>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr style="text-align: left; height: 50px; background-color: #c2c2c2;">
                                        <td align="center" style="text-align: right; padding-right: 15px;">
                                            <a href="<%# GenerateURL(DataBinder.Eval(Container.DataItem, "Articls_Title"),DataBinder.Eval(Container.DataItem, "Articls_ID")) %>">
                                                <%# SplitString(DataBinder.Eval(Container.DataItem, "Articls_Title").ToString()) %></a>
                                        </td>
                                        <td align="center" style="text-align: center;">
                                            <%# DataBinder.Eval(Container.DataItem, "Articls_Counter")%>
                                        </td>
                                        <td align="center" style="text-align: center;">
                                            <%# ArticlsStatus(DataBinder.Eval(Container.DataItem, "Articls_Status").ToString()) %>
                                        </td>
                                        <td class="options-width" style="text-align: left; padding-left: 10px;">
                                            <a onclick="DeleteArticls(<%# DataBinder.Eval(Container.DataItem, "Articls_ID")%>)"
                                                title="View" style="cursor:pointer;">
                                                <img src="images/remove.png" style="border: 0px;" alt="Livekora.net" />
                                            </a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr class="alternate-row" style="text-align: left; height: 50px; background-color: #ffffff;">
                                        <td align="center" style="text-align: right; padding-right: 15px;">
                                            <a href="<%# GenerateURL(DataBinder.Eval(Container.DataItem, "Articls_Title"),DataBinder.Eval(Container.DataItem, "Articls_ID")) %>">
                                                <%# SplitString(DataBinder.Eval(Container.DataItem, "Articls_Title").ToString()) %></a>
                                        </td>
                                        <td align="center" style="text-align: center;">
                                            <%# DataBinder.Eval(Container.DataItem, "Articls_Counter")%>
                                        </td>
                                        <td align="center" style="text-align: center;">
                                            <%# ArticlsStatus(DataBinder.Eval(Container.DataItem, "Articls_Status").ToString()) %>
                                        </td>
                                        <td class="options-width" style="text-align: left; padding-left: 10px;">
                                            <a onclick="DeleteArticls(<%# DataBinder.Eval(Container.DataItem, "Articls_ID")%>)"
                                                title="View" style="cursor:pointer;">
                                                <img src="images/remove.png" style="border: 0px;" alt="Livekora.net" />
                                            </a>
                                        </td>
                                    </tr>
                                </AlternatingItemTemplate>
                            </asp:Repeater>
                        </table>
                        <!--  end product-table................................... -->
                    </div>
                    <!--  end content-table  -->
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner ............................................END  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
    </table>
    <asp:Button ID="lbtnRefreshGV" CssClass="ClassHideDiv" runat="server" Text="" Height="0px"
        Width="0px" Style="visibility: hidden" OnClick="lbtnRefreshGV_Click"></asp:Button>
</asp:Content>
